package com.jinsi.service.tang.iml;

import com.jinsi.mapper.tang.CommodityStatisticsMapper;
import com.jinsi.pojo.InfoDataUser;
import com.jinsi.service.tang.CommodityStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 商品统计展示
 * @author 唐文博
 * @Date 2022-09-03
 */
@Service
@Transactional
public class CommodityStatisticsServiceImpl implements CommodityStatisticsService {
    @Autowired
    private CommodityStatisticsMapper commodityStatisticsMapper;

    /**
     * 获取7天内每天商品的上架、下架和删除的个数
     * @param commodityState
     * @return
     */
    @Override
    @Transactional(readOnly = true)
    public List<InfoDataUser> getCommodityStatistics(Integer commodityState) {
        return commodityStatisticsMapper.getCommodityStatistics(commodityState);
    }
}
